package com.masblearn;

public class TankWallColider implements Colider {


    @Override
    public boolean colider(GameObject o1, GameObject o2) {
        if (o1 instanceof Wall && o2 instanceof Tank) {
            Wall b = (Wall) o1;
            Tank t = (Tank) o2;

            if (b.rectangle.intersects(t.rectangle)) {
                t.back();
//                t.gm.add(new Explode(t.getX() + t.TANK_WIDTH / 2 - Explode.Width / 2, t.getY() + t.TANK_HEIGHT / 2 - Explode.Heiht / 2, t.gm));
            }
//            return false;
        } else if (o1 instanceof Tank && o2 instanceof Wall) {
            colider(o2, o1);
        }
        return true;
    }
}
